From: Keir Fraser Date: Thu, 23 Oct 2008 11:01:03 +0000 (+0100) Subject: hpet cpuidle: Observe IRQ-safe locking protocol. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14054^2~42 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=13dbb4fd446a7f93e63120069480a5a3d416cf20;p=xen.git hpet cpuidle: Observe IRQ-safe locking protocol. Otherwise, may encounter deadlock. Signed-off-by: Wei Gang Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index 5a660245b6..443d487f67 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -146,7 +146,7 @@ static void handle_hpet_broadcast(struct hpet_event_channel *ch) s_time_t now, next_event; int cpu; - spin_lock(&ch->lock); + spin_lock_irq(&ch->lock); again: ch->next_event = STIME_MAX; @@ -171,7 +171,7 @@ again: if ( reprogram_hpet_evt_channel(ch, next_event, now, 0) ) goto again; } - spin_unlock(&ch->lock); + spin_unlock_irq(&ch->lock); } void hpet_broadcast_init(void) @@ -213,6 +213,7 @@ void hpet_broadcast_enter(void) { struct hpet_event_channel *ch = &hpet_event; + ASSERT(!local_irq_is_enabled()); spin_lock(&ch->lock); disable_APIC_timer();